package com.tianhui.consignortwofei.mvp.model.hetong;

import android.content.Context;

import com.fgs.common.CommonModel;
import com.fgs.common.api.CommonConfig;
import com.fgs.common.progress.ObserverResponseListener;
import com.tianhui.consignortwofei.api.AccountApiService;


import java.util.Map;

import io.reactivex.ObservableTransformer;

/**
 * @author fgs
 * @date 2020/3/27
 **/
public class LoginModel<T> extends CommonModel {

    public void loginModel(Context context, Map<String, String> map, boolean isDialog,
                           ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        //当不需要指定是否由dialog时，可以调用这个方法
        subscribe(context, CommonConfig.getInstance().create(AccountApiService.class).login(map), observerListener, transformer, isDialog, true);
    }

    public void loginOutModel(Context context, boolean isDialog,
                              ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        //当不需要指定是否由dialog时，可以调用这个方法
        subscribe(context, CommonConfig.getInstance().create(AccountApiService.class).loginOut(), observerListener, transformer, isDialog, true);
    }
}
